<template>
  <area-form @save="handleSave" @cancel="$emit('cancel')" :details="details"/>
</template>

<script>
import { createArea } from '@/api/adminArea'
import AreaForm from './areaForm'

export default {
  name: 'AreaAdd',
  props:{
    details:{}
  },
  data() {
    return {}
  },

  methods: {
    handleSave(params) {
      createArea(params)
        .then(res => {
          this.$message({
            message: '添加行政区域成功！',
            type: 'success'
          })
          this.$emit('add')
        })
    }
  },

  components: {
    AreaForm
  }
}
</script>


